<?php 
include_once '../action/userController.php';
?>
<!DOCTYPE html>  
<html lang="en">  
<head>  
	<meta charset="utf-8">  
	<title>Aplikasi Cuti KPPN</title>   
	<meta name="author" content="Arif Setiyanto @ Tugas Akhir Sistem Informasi ITS 2013">  
	<link href="tema/css/bootstrap.css" rel="stylesheet"> 
	<link href="tema/css/example-fluid-layout.css" rel="stylesheet">
        <link href="tema/css/example-fixed-layout.css" rel="stylesheet">
        <script type="text/javascript" src="tema/js/jquery.1.7.1.min.js"></script>
        <link tipe="text/css" href="tema/css/jquery.ui.all.css" rel="stylesheet">
        <link tipe="text/css" href="tema/css/jquery.ui.datepicker.css" rel="stylesheet">
        <script type="text/javascript" src="tema/js/jquery.ui.datepicker.js"></script>
        <script type="text/javascript" src="tema/js/jquery.ui.core.js"></script>
        <script type="text/javascript" src="tema/js/jquery.ui.datepicker-id.js"></script>
        <script type="text/javascript" src="../library/DataTables-1.9.4/media/js/jquery.dataTables.js"></script>
        <script type="text/javascript" src="../library/DataTables-1.9.4/media/js/jquery.dataTables.min.js"></script>
</head>  
<body>  
	<div id="header" class="navbar navbar-fixed-top">  
		<div class="navbar-inner">  
			<div class="container">  
                           <ul class="nav">   
                                     <?php
                                        if(isset($_SESSION['nip'])){?>
					<li><?php echo '<a href="index.php">Halaman Utama</a>' ?></li>  
					<li><?php echo '<a href="modul.pegawai.php?view">Pegawai</a>' ?></li>   
				</ul>  
				
				<ul class="nav">  
					<li class="dropdown">  
						<?php echo '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Manajemen Cuti<b class="caret"></b></a>' ?>  
						<ul class="dropdown-menu">  
							<li><a href="cuti.kolektif.php">Lihat Daftar Pengajuan Cuti Kantor</a></li>  
							<li><a href="cuti.pribadi.php?view">Lihat Daftar Pengajuan Cuti Pribadi</a></li>
                                                        <li><a href="alih.tanggungjawab.php">Permintaan Alih Tanggungjawab Pekerjaan</a></li>
						</ul>  
					</li>  
				</ul>  
				<?php if($_SESSION['admin']=="Y" OR $_SESSION['pejabat']!="T"){ ?>	
				<ul class="nav">  
					<li class="dropdown">  
						<?php echo '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Pengaturan & Referensi<b class="caret"></b></a>' ?>  
						<ul class="dropdown-menu">  
						<?php   if($_SESSION['admin']=="Y"){ ?>
                                                        <li><a href="pengaturan.kantor.php?view">Pengaturan Kantor</a></li>  							
                                                        <li><a href="pengaturan.tahuncuti.php">Pengaturan Tahun Cuti</a></li>
                                                        <li><a href="pengaturan.backuprestore.php">Backup & Restore</a></li>
                                                <?php } if($_SESSION['pejabat']!="T"){ ?>
                                                        <li><a href="pengaturan.kuota.php?view">Pengaturan Kuota Cuti</a></li>
                                                <?php } ?>
                                                        <li><a href="pengaturan.password.php">Pengaturan Kata Sandi</a></li>                                                      
							<li><a href="pengaturan.lcb.php?view">Referensi & Pengaturan Libur dan Cuti Bersama</a></li>
                                                        <li><a href="pengaturan.pejabat.php?view">Referensi & Pengaturan Pejabat</a></li>
                                                        
						</ul>  
					</li>  
				</ul> 
                                <?php } ?>
                                                    
				<ul class="nav">  
					<?php 
                                        echo '<li><a href="../action/logoutController.php">Keluar</a></li>';?>                                    
                                </ul>
                                
                            
			</div>
		</div>
	</div>
    <div class="container-fluid">
        <ul class="pull-left">
            Selamat datang, <strong><?php echo $_SESSION['nama']; ?></strong>
        </ul>
        <?php if($data_role!=NULL){ ?>
        <ul class="pull-right">
                <div class="input-prepend"><span class="add-on">Pilih Role :</span> 
                        <select name="role_baru" id="role_baru">
                        <?php
                            foreach($data_role as $rolenya){
                                $roles=explode(",",$rolenya->role);
                                if($_SESSION['pejabat']==$roles[0]){
                                    echo "<option value=\"".$roles[0]."\" selected>".$roles[1]."</option>";
                                }else{
                                    echo "<option value=\"".$roles[0]."\">".$roles[1]."</option>";
                                }
                            }
                        ?>
                    </select>
                </div>  
        </ul>
        <?php }
        }?>
<script>
        $(document).ready(function(){
            $('#role_baru').change(function(){
                var role=$('#role_baru').val();
                $.ajax({
                    type:"POST",
                    url:"",
                    data:'role=' + role,
                    success:function(html){
                        alert("Berhasil mengubah role");
                        window.self.location.reload();
                    }
                });
            });
        });
</script>
    </div>
<?php // if(isset($_SESSION['nip']))var_dump('nip='.$_SESSION['nip'].'-password='.$_SESSION['pass'].'-membawahi bagian='.$_SESSION['pejabat'].'-bagian='.$_SESSION['bagian'].'-admin='.$_SESSION['admin']); ?>